package com.tepth.busfix.main.partsearch;

import com.tepth.busfix.base.BaseModel;
import com.tepth.busfix.base.BasePresenter;
import com.tepth.busfix.base.BaseView;
import com.tepth.busfix.bean.reponse.SearchPartResult;
import com.tepth.busfix.bean.reponse.TroubleContent;
import com.tepth.busfix.network.ApiModel;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * Created by pc on 2017/3/17.
 */

public class PartSearchContract {

    interface View extends BaseView {
        String getAuthKey();

        String getName();

        int getCount();

        void showSearchResult(int accessorySize, int componentSize, ArrayList<TroubleContent.Part> list);

        void showCommonComponents(int accessorySize, int componentSize,ArrayList<TroubleContent.Part> list);
    }

    interface Model extends BaseModel {
        Observable<ApiModel<SearchPartResult>> searchPart(String authKey, String name);

        Observable<ApiModel<SearchPartResult>> getCommonComponents(String authKey, int count);
    }

    abstract static class Presenter extends BasePresenter<Model, View> {

        @Override
        public void onStart() {

        }

        abstract void search();

        abstract void getCommonComponents();
    }
}